package com.uppfind.framework.core.dao.mybatis.utils;

/**
 * Created by xuliugen on 2017/7/3.
 */
public class AssemblerGetAndSetMethodUtil {

    private final static String INVOKE_METHOD_GET = "get";
    private final static String INVOKE_METHOD_SET = "set";

    public static String getMethod(String filed) {
        return INVOKE_METHOD_GET + getFirstCharToUpper(filed);
    }

    public static String setMethod(String filed) {
        return INVOKE_METHOD_SET + getFirstCharToUpper(filed);
    }

    private static String getFirstCharToUpper(String filed) {
        return filed.substring(0, 1).toUpperCase() + filed.substring(1, filed.length());
    }

    public static void main(String[] args) {
        System.out.println(getMethod("userName"));
        System.out.println(setMethod("userName"));
    }
}
